package P1.gaojingdu;

import java.util.Scanner;
import java.util.Vector;

/**
 * @date:2022/10/23
 * @author:LdLtd
 * @name:A+B
 */

public class Add {
    static final Long N=1000010L;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a,b;
        Vector<Integer> A = new Vector<>(),B=new Vector<>();
         a = sc.next();  //a='123456'
         b= sc.next();
        //倒序存储，方便直接计算进位 将每一位字符转换为数字进行存储
        for (int i = a.length()-1; i >=0; i--) {
            A.addElement(a.charAt(i)-'0');
        }//A-[6,5,4,3,2,1]
        for (int i = b.length()-1; i >=0; i--) {
            B.addElement(b.charAt(i)-'0');
        }
        Vector<Integer> C=add(A,B);
        //注意同样需要倒序输出
        for (int i = C.size()-1; i >=0; i--) {
            System.out.print(C.get(i));
        }
    }
    public static Vector<Integer> add(Vector<Integer> A,Vector<Integer> B){
            Vector<Integer> C =new Vector<>();
            int t=0;
        for (int i = 0; i < A.size()||i<B.size(); i++) {
            if(i<A.size()) t+= A.get(i);
            if(i<B.size()) t+= B.get(i);
            C.add(t%10);
            t/=10;
        }
        if(t!=0) C.add(1);
        return C;
    }
}
